package com.lening.organization.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lening.organization.dto.RoleDTO;
import com.lening.organization.dto.RoleMenuDTO;
import com.lening.organization.po.Role;
import org.apache.ibatis.annotations.Param;

import java.util.List;

//@Mapper
public interface RoleMapper extends BaseMapper<Role> {

    static void addRoleMenu(RoleMenuDTO roleMenuDTO) {
    }

    Page<Role> findRole(Integer pageNum, Integer pageSize, Page<RoleDTO> roleDTO);

    /**
     * 根据id查询用户的全部角色
     */
    List<Integer> findRoleMenuByRoleId(Integer id);
    /**
     * 根据ID删除岗位角色中间表
     */
    void deleteByRoleId(Integer id);
    /**
     * 添加用户岗位中间表
     */
    void addUserRole(@Param("id") Integer id, @Param("roleId")List<Integer> roleId);

}
